home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 85 / CD Actual 85 Febrero 2004.iso / Experto / Apache / apache_2.0.48-win32-x86-no_ssl.msi / Data.Cab / F252522_mod_expires.html.en < prev    next >
Encoding:
Extensible Markup Language  |  2003-05-29  |  12.6 KB  |  230 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
  4.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5.               This file is generated from xml source: DO NOT EDIT
  6.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7.       -->
  8. <title>mod_expires - Apache HTTP Server</title>
  9. <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
  10. <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
  11. <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
  12. <link href="../images/favicon.ico" rel="shortcut icon" /></head>
  13. <body>
  14. <div id="page-header">
  15. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
  16. <p class="apache">Apache HTTP Server Version 2.0</p>
  17. <img alt="" src="../images/feather.gif" /></div>
  18. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  19. <div id="path">
  20. <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs-project/">Documentation</a> > <a href="../">Version 2.0</a> > <a href="./">Modules</a></div>
  21. <div id="page-content">
  22. <div id="preamble"><h1>Apache Module mod_expires</h1>
  23. <div class="toplang">
  24. <p><span>Available Languages: </span><a href="../en/mod/mod_expires.html" title="English"> en </a></p>
  25. </div>
  26. <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Generation of <code>Expires</code> HTTP headers according to
  27. user-specified criteria</td></tr>
  28. <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  29. <tr><th><a href="module-dict.html#ModuleIdentifier">ModuleáIdentifier:</a></th><td>expires_module</td></tr>
  30. <tr><th><a href="module-dict.html#SourceFile">SourceáFile:</a></th><td>mod_expires.c</td></tr></table>
  31. <h3>Summary</h3>
  32.  
  33.     <p>This module controls the setting of the <code>Expires</code>
  34.     HTTP header in server responses. The expiration date can set to
  35.     be relative to either the time the source file was last
  36.     modified, or to the time of the client access.</p>
  37.  
  38.     <p>The <code>Expires</code> HTTP header is an instruction to
  39.     the client about the document's validity and persistence. If
  40.     cached, the document may be fetched from the cache rather than
  41.     from the source until this time has passed. After that, the
  42.     cache copy is considered "expired" and invalid, and a new copy
  43.     must be obtained from the source.</p>
  44. </div>
  45. <div id="quickview"><h3 class="directives">Directives</h3>
  46. <ul id="toc">
  47. <li><img alt="" src="../images/down.gif" /> <a href="#expiresactive">ExpiresActive</a></li>
  48. <li><img alt="" src="../images/down.gif" /> <a href="#expiresbytype">ExpiresByType</a></li>
  49. <li><img alt="" src="../images/down.gif" /> <a href="#expiresdefault">ExpiresDefault</a></li>
  50. </ul>
  51. <h3>Topics</h3>
  52. <ul id="topics">
  53. <li><img alt="" src="../images/down.gif" /> <a href="#AltSyn">Alternate Interval Syntax</a></li>
  54. </ul></div>
  55. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  56. <div class="section">
  57. <h2><a name="AltSyn" id="AltSyn">Alternate Interval Syntax</a></h2>
  58.     <p>The <code class="directive"><a href="#expiresdefault">ExpiresDefault</a></code> and
  59.     <code class="directive"><a href="#expiresbytype">ExpiresByType</a></code> directives
  60.     can also be defined in a more readable syntax of the form:</p>
  61.  
  62.     <div class="example"><p><code>
  63.       ExpiresDefault "<base> [plus] {<num>
  64.       <type>}*"<br />
  65.       ExpiresByType type/encoding "<base> [plus]
  66.       {<num> <type>}*"
  67.     </code></p></div>
  68.  
  69.     <p>where <base> is one of:</p>
  70.  
  71.     <ul>
  72.       <li><code>access</code></li>
  73.  
  74.       <li><code>now</code> (equivalent to
  75.       '<code>access</code>')</li>
  76.  
  77.       <li><code>modification</code></li>
  78.     </ul>
  79.  
  80.     <p>The <code>plus</code> keyword is optional. <num>
  81.     should be an integer value [acceptable to <code>atoi()</code>],
  82.     and <type> is one of:</p>
  83.  
  84.     <ul>
  85.       <li><code>years</code></li>
  86.       <li><code>months</code></li>
  87.       <li><code>weeks</code></li>
  88.       <li><code>days</code></li>
  89.       <li><code>hours</code></li>
  90.       <li><code>minutes</code></li>
  91.       <li><code>seconds</code></li>
  92.     </ul>
  93.  
  94.     <p>For example, any of the following directives can be used to
  95.     make documents expire 1 month after being accessed, by
  96.     default:</p>
  97.  
  98.     <div class="example"><p><code>
  99.       ExpiresDefault "access plus 1 month"<br />
  100.       ExpiresDefault "access plus 4 weeks"<br />
  101.       ExpiresDefault "access plus 30 days"
  102.     </code></p></div>
  103.  
  104.     <p>The expiry time can be fine-tuned by adding several
  105.     '<num> <type>' clauses:</p>
  106.  
  107.     <div class="example"><p><code>
  108.       ExpiresByType text/html "access plus 1 month 15
  109.       days 2 hours"<br />
  110.       ExpiresByType image/gif "modification plus 5 hours 3
  111.       minutes"
  112.     </code></p></div>
  113.  
  114.     <p>Note that if you use a modification date based setting, the
  115.     Expires header will <strong>not</strong> be added to content
  116.     that does not come from a file on disk. This is due to the fact
  117.     that there is no modification time for such content.</p>
  118. </div>
  119. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  120. <div class="directive-section"><h2><a name="ExpiresActive" id="ExpiresActive">ExpiresActive</a> <a name="expiresactive" id="expiresactive">Directive</a></h2>
  121. <table class="directive">
  122. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables generation of Expires
  123. headers</td></tr>
  124. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ExpiresActive On|Off</code></td></tr>
  125. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  126. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
  127. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  128. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_expires</td></tr>
  129. </table>
  130.     <p>This directive enables or disables the generation of the
  131.     <code>Expires</code> header for the document realm in question.
  132.     (That is, if found in an <code>.htaccess</code> file, for
  133.     instance, it applies only to documents generated from that
  134.     directory.) If set to <code>Off</code>, no <code>Expires</code> header
  135.     will be generated for any document in the realm (unless overridden at
  136.     a lower level, such as an <code>.htaccess</code> file overriding a
  137.     server config file). If set to <code>On</code>, the header will be
  138.     added to served documents according to the criteria defined by the 
  139.     <code class="directive"><a href="#expiresbytype">ExpiresByType</a></code> and 
  140.     <code class="directive"><a href="#expiresdefault">ExpiresDefault</a></code> directives
  141.     (<em>q.v.</em>).</p>
  142.  
  143.     <p>Note that this directive does not guarantee that an
  144.     <code>Expires</code> header will be generated. If the criteria
  145.     aren't met, no header will be sent, and the effect will be as
  146.     though this directive wasn't even specified.</p>
  147.  
  148. </div>
  149. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  150. <div class="directive-section"><h2><a name="ExpiresByType" id="ExpiresByType">ExpiresByType</a> <a name="expiresbytype" id="expiresbytype">Directive</a></h2>
  151. <table class="directive">
  152. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Value of the Expires header configured
  153. by MIME type</td></tr>
  154. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ExpiresByType <var>MIME-type</var>
  155. <var><code>seconds</var></code></td></tr>
  156. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  157. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
  158. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  159. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_expires</td></tr>
  160. </table>
  161.     <p>This directive defines the value of the <code>Expires</code>
  162.     header generated for documents of the specified type (<em>e.g.</em>,
  163.     <code>text/html</code>). The second argument sets the number of
  164.     seconds that will be added to a base time to construct the expiration
  165.     date.</p>
  166.  
  167.     <p>The base time is either the last modification time of the
  168.     file, or the time of the client's access to the document. Which
  169.     should be used is specified by the
  170.     <code><var><code></var></code> field; <code>M</code>
  171.     means that the file's last modification time should be used as
  172.     the base time, and <code>A</code> means the client's access
  173.     time should be used.</p>
  174.  
  175.     <p>The difference in effect is subtle. If <code>M</code> is used,
  176.     all current copies of the document in all caches will expire at
  177.     the same time, which can be good for something like a weekly
  178.     notice that's always found at the same URL. If <code>A</code> is
  179.     used, the date of expiration is different for each client; this
  180.     can be good for image files that don't change very often,
  181.     particularly for a set of related documents that all refer to
  182.     the same images (<em>i.e.</em>, the images will be accessed
  183.     repeatedly within a relatively short timespan).</p>
  184.  
  185.     <div class="example"><h3>Example:</h3><p><code>
  186.       # enable expirations<br />
  187.       ExpiresActive On<br />
  188.       # expire GIF images after a month in the client's cache<br />
  189.       ExpiresByType image/gif A2592000<br />
  190.       # HTML documents are good for a week from the<br />
  191.       # time they were changed<br />
  192.       ExpiresByType text/html M604800
  193.     </code></p></div>
  194.  
  195.     <p>Note that this directive only has effect if
  196.     <code>ExpiresActive On</code> has been specified. It overrides,
  197.     for the specified MIME type <em>only</em>, any expiration date
  198.     set by the <code class="directive"><a href="#expiresdefault">ExpiresDefault</a></code>
  199.     directive.</p>
  200.  
  201.     <p>You can also specify the expiration time calculation using
  202.     an <a href="#AltSyn">alternate syntax</a>, described earlier in
  203.     this document.</p>
  204.  
  205. </div>
  206. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  207. <div class="directive-section"><h2><a name="ExpiresDefault" id="ExpiresDefault">ExpiresDefault</a> <a name="expiresdefault" id="expiresdefault">Directive</a></h2>
  208. <table class="directive">
  209. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default algorithm for calculating expiration time</td></tr>
  210. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ExpiresDefault <var><code>seconds</var></code></td></tr>
  211. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  212. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Indexes</td></tr>
  213. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
  214. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_expires</td></tr>
  215. </table>
  216.     <p>This directive sets the default algorithm for calculating the
  217.     expiration time for all documents in the affected realm. It can be
  218.     overridden on a type-by-type basis by the <code class="directive"><a href="#expiresbytype">ExpiresByType</a></code> directive. See the
  219.     description of that directive for details about the syntax of the
  220.     argument, and the <a href="#AltSyn">alternate syntax</a>
  221.     description as well.</p>
  222.  
  223. </div>
  224. </div>
  225. <div class="bottomlang">
  226. <p><span>Available Languages: </span><a href="../en/mod/mod_expires.html" title="English"> en </a></p>
  227. </div><div id="footer">
  228. <p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
  229. <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
  230. </body></html>